//
//  WH_AppTools.h
//  App_6.23
//
//  Created by wanghao on 16/6/29.
//  Copyright © 2016年 wanghao. All rights reserved.
//

#import <Foundation/Foundation.h>


typedef void(^AppToolsBlock ) (id result);
typedef void(^AppToolsErrorBlock) (NSError *error);

typedef NS_ENUM(NSUInteger, HXResult) {
    HXData,
    HXJSON,
    HXXML,
};
typedef NS_ENUM(NSUInteger, HXRequestStyle) {
    HXRequestJSON,
    HXRequestString,
    HXRequestDic,
};

@interface WH_AppTools : NSObject

+(void)getDataWithURL:(NSString *)urlStr block:(AppToolsBlock)block error:(AppToolsErrorBlock)errorBlock;
/**
 *  Post请求
 *
 *  @param url          网络请求地址
 *  @param body         请求体
 *  @param result       返回值的数据类型
 *  @param requestStyle 网络请求Body的类型
 *  @param headerFile   网络请求头
 *  @param success      成功回调
 *  @param failure      失败回调
 */
+ (void)postUrl:(NSString *)url
           body:(id)body
         result:(HXResult)result
   requestStyle:(HXRequestStyle)requestStyle
     headerFile:(NSDictionary *)headerFile
        success:(void (^)(id result))success
        failure:(void (^)(NSError *error))failure;

+(void)changeColor:(NSString *)title color:(UIColor *)color xx:(NSString *)cc nn:(UILabel *)moreTitleLabel;
+ (NSString *)currentData;
+ (NSString *)intervalSinceNow: (NSString *) theDate;
+ (CGSize)labelRectWithSize:(CGSize)size
                 LabelText:(NSString *)labelText
                       Font:(UIFont *)font;
+ (NSString *)intervalFromLastDate: (NSString *) dateString1  toTheDate:(NSString *) dateString2;
@end
